import VueRouter from 'vue-router'
import Vue from 'vue'
import Layout from '@/views/layout/Layout'

const routes = [
	{
		path: '/login',
		component: () => import('@/views/login/index')
	},
	{
		path: '/',
		name: '首页',
		component: Layout,
		redirect: '/dashboard',
		meta: { title: '首页'},
		children: [
			{
				path : 'dashboard',
				component: () => import('@/views/dashboard/index'),
				meta: { title: '仪表盘', icon: 'dashboard' }
			}
		]
	},
	{
		path: '/blog',
		component: Layout,
		redirect: '/blog/blog',
		name: '博客管理',
		meta: { title: '博客管理', icon: 'edit' },
		children: [
			{
				path: 'blog',
				name: '博客管理',
				component: () => import('@/views/blog/blog'),
				meta: { title: '博客管理', icon: 'edit' }
			},
			{
				path: 'blogSort',
				name: '分类管理',
				component: () => import('@/views/blog/blogSort'),
				meta: { title: '分类管理', icon: 'sort' }
			}						
		]
	}		
]
const router = new VueRouter({
	routes: routes
})
Vue.use(VueRouter)

export default router